package com.lcry.springcloudalibaba.controller;


import com.lcry.springcloudalibaba.domain.CommonResult;
import com.lcry.springcloudalibaba.domain.Order;
import com.lcry.springcloudalibaba.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lcry
 * @date 2020/03/18 12:32
 */
@RestController
public class OrderController {
    @Resource
    private OrderService orderService;


    /**
     * 创建订单
     *
     * @param order
     * @return
     */
    @PostMapping("/order/create")
    public CommonResult create(@RequestBody Order order) {
        orderService.create(order);
        return new CommonResult(200, "订单创建成功");
    }
}